package com.atcc.test.common;

import com.atcc.test.domain.CommonResult;

public class ResultUtil {
	
	public static <T> CommonResult<T> returnSuccess(T data){
		CommonResult<T> result = new CommonResult<T>();
		result.setData(data);
		result.setSuccess(true);
		result.setCode(ErrorCodeEnum.CODE_SUCCESS.getCode());
		result.setMessage(ErrorCodeEnum.CODE_SUCCESS.getDesc());
		return result;
	}
	
	public static <T> CommonResult<T> returnError(){
		CommonResult<T> result = new CommonResult<T>();
		result.setSuccess(false);
		result.setCode(ErrorCodeEnum.NOPHONE_ERROR.getCode());
		result.setMessage(ErrorCodeEnum.NOPHONE_ERROR.getDesc());
		return result;
	}

}
